import Mock from 'mockjs'

const LoginUsers = [{
  id: 1,
  username: '13067873183',
  password: '000000',
  avatar: 'https://raw.githubusercontent.com/taylorchen709/markdown-images/master/vueadmin/user.png',
  name: '张三'

}]

const Users = []
for (let i = 0; i < 80; i++) {
  Users.push(Mock.mock({
    id: Mock.Random.guid(),
    name: Mock.Random.cname(),
    addr: Mock.mock('@county(true)'),
    'age|18-60': 1,
    birth: Mock.Random.date(),
    sex: Mock.Random.integer(0, 1)
  }))
}

const Hospitals = []
for (let i = 0; i < 30; i++) {
  Hospitals.push(Mock.mock({
    id: Mock.Random.guid(),
    name: Mock.Random.cname() + '的XXXX医院',
    address: Mock.mock('@county(true)'),
    'type|1-10': 1
  }))
}

const Departments = []
const getChildren = () => {
  return Mock.mock({
    'list|5-30': [{
      id: Mock.Random.guid(),
      'name': '@city'
    }]
  })
}
for (let i = 0; i < 30; i++) {
  Departments.push(Mock.mock({
    id: Mock.Random.id(),
    name: Mock.Random.cname() + '科科科科',
    children: getChildren(),
    'type|1-10': 1
  }))
}

const Doctors = []
for (let i = 0; i < 10; i++) {
  Doctors.push(Mock.mock({
    id: Mock.Random.id(),
    name: Mock.Random.cname(),
    'depart|+1': ['产科门诊', '内科门诊'],
    'jobTitle|+1': ['主任医生', '副主任医生'],
    'desc': '@cparagraph(6,10)',
    'img': '@image("60*70")'
  }))
}

const Orders = []
for (let i = 0; i < 8; i++) {
  Orders.push(Mock.mock({
    id: Mock.Random.id(),
    name: Mock.Random.cname(),
    'price|10-100': 0,
    'time': '08:00-08:30',
    'left|5-30': 0
  }))
}

const Appoints = []
for (let i = 0; i < 8; i++) {
  Appoints.push(Mock.mock({
    id: Mock.Random.id(),
    name: Mock.Random.cname(),
    'idcard': /\d{18}/,
    'datetime': '@datetime()',
    'hospital|+1': ['江苏省中医院', '苏州市中医院'],
    'type|1-3': 0
  }))
}

export {LoginUsers, Users, Hospitals, Departments, Doctors, Orders, Appoints}
